<template>
  <div>
    <span>标题:</span>
    <el-input
      style="width: 200px; margin: 0 0 0 0.5vw"
      v-model="queryForm.title"
      placeholder="请输入内容"
      size="small"
    ></el-input>
    <span style="margin: 0 0 0 1vw">日期:</span>
    <el-date-picker
      v-model="queryForm.date"
      style="width: 200px; margin: 0 0 0 0.5vw"
      placeholder="选择日期时间"
      type="date"
      value-format="yyyy-MM-dd"
      format="yyyy-MM-dd"
      size="small"
    >
    </el-date-picker>
    <el-button
      type="primary"
      size="small"
      style="margin: 0 0 0 1vw"
      @click="search"
      >查询</el-button
    >
    <el-button
      type="primary"
      size="small"
      style="margin: 0 0 0 1vw"
      @click="add"
      >新增</el-button
    >
    <dialog-view
      :show="show"
      @close="close"
      :title="titles"
      @refresh="refresh"
    />
  </div>
</template>

<script>
import dialogView from "./dialogView.vue";
export default {
  components: {
    dialogView,
  },
  data() {
    return {
      show: false,
      titles: "",
      queryForm: {
        title: "",
        date: "",
      },
    };
  },
  methods: {
    search() {
      this.$emit("searches", this.queryForm);
    },
    add() {
      this.show = true;
      this.titles = "通知-新增";
    },
    close(e) {
      if (e == true) {
        this.show = false;
        this.$parent.pag.pageNo = 1;
        this.$parent.getlist({ pageNo: this.$parent.pag.pageNo, pageSize: 5 });
      }
    },
    //刷新
    refresh(e) {
      if (e == true) {
        this.show = false;
        this.$parent.pag.pageNo = 1;
        this.$parent.getlist({ pageNo: this.$parent.pag.pageNo, pageSize: 5 });
      }
    },
  },
};
</script>

<style>
</style>